package com.atguigu.gmall.order;

/**
 * @author wk
 * @create 2021-09-10 20:30
 */

import com.atguigu.gmall.common.intercepator.FeignInterceptor;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;

@SpringBootApplication
@ComponentScan(basePackages = "com.atguigu.gmall")
@EnableDiscoveryClient
@EnableFeignClients(basePackages = "com.atguigu.gmall")
public class ServiceOrderApplication {
    public static void main(String[] args) {
        SpringApplication.run(ServiceOrderApplication.class, args);
    }
    /**
     * 实例化拦截器
     * 当远程调用时 如果需要携带用户id 先走拦截器
     */
    @Bean
    public FeignInterceptor getFeignInterceptor() {
        return new FeignInterceptor();
    }
}
